﻿<phone:PhoneApplicationPage x:Class="AuchanScan.Views.BarCodePage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait"
                            mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480" shell:SystemTray.IsVisible="True"
                            DataContext="{Binding Path=MainViewModel,Source={StaticResource ViewModelLocator}}">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot" Margin="0,0,0,-13">
    <Grid.Background>
      <ImageBrush Stretch="Fill" ImageSource="/images/Page_Background.png" />
    </Grid.Background>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
      <Grid x:Name="CardGrid" HorizontalAlignment="Center" Width="443" Height="254" VerticalAlignment="Center" Margin="0,-110,0,0" Visibility="Collapsed"  >
      	<Rectangle RadiusX="15" RadiusY="15" Fill="#fffe000d" />
      	<Border HorizontalAlignment="Center" VerticalAlignment="Bottom" Background="White" Margin="0,0,0,11" >
      		<TextBlock Text="{Binding Text, ElementName=tbBarCode}" x:Name="tblBarCode" FontFamily="/AuchanScan;component/Fonts/Fonts.zip#EAN-13" FontSize="96" Margin="24,12" />
      	</Border>
      	<Image Height="50" Source="images/Logo.png" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="11,12,0,0"/>
    	</Grid>
      <StackPanel x:Name="CreateCardGrid" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-143,0,0">
        <TextBox Text="{Binding Datas.BarCode, Mode=TwoWay}"  x:Name="tbBarCode" Height="70" Width="400" HorizontalAlignment="Center" VerticalAlignment="Center" InputScope="Number" MaxLength="13" FontFamily="Segoe WP Semibold" />
        <TextBlock Text="(Code barre à 13 caractères)" Visibility="{Binding Visibility, ElementName=tblBarCode}"/>
        <Button x:Name="btSave" Click="Save_Click" Visibility="{Binding Visibility, ElementName=tbBarCode}" Content="Sauvegarder" HorizontalAlignment="Center" VerticalAlignment="Center" />
      </StackPanel>
    </Grid>
  </Grid>
 
  <!--Sample code showing usage of ApplicationBar-->
  <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" x:Name="appBar1">
      <shell:ApplicationBarIconButton IconUri="/icons/appbar.edit.rest.png" Text="modifier" Click="Edit_Click" />
      <shell:ApplicationBarIconButton IconUri="/icons/appbar.favs.addto.rest.png" Text="épingler" Click="Pin_Click" />
    </shell:ApplicationBar>
  </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>